package com.econ.powercloud.ems.common.enums;

/**
 * @Author : zjf
 * @Description : 电表报表中的列配置信息
 * @Date : 2022/5/26 14:19
 * @Modified by : zjf
 */
public enum MeterColumnConfigType {

    EPPT ("Eppt","正向有功(总)",1),
    EPP1 ("Epp1","正向有功(尖)",2),
    EPP2 ("Epp2","正向有功(峰)",3),
    EPP3 ("Epp3","正向有功(平)",4),
    EPP4 ("Epp4","正向有功(谷)",5),

    ENPT ("Enpt","反向有功(总)",6),
    ENP1 ("Enp1","反向有功(尖)",7),
    ENP2 ("Enp2","反向有功(峰)",8),
    ENP3 ("Enp3","反向有功(平)",9),
    ENP4 ("Enp4","反向有功(谷)",10),
    ;

    private String code;
    private String desc;
    private Integer sorting;

    public String getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }

    public Integer getSorting() {
        return sorting;
    }

    MeterColumnConfigType(String code, String desc, Integer sorting){
        this.code=code;
        this.desc=desc;
        this.sorting=sorting;
    }

    public static MeterColumnConfigType fromCode(String code){
        for(MeterColumnConfigType type: MeterColumnConfigType.values()){
            if(type.getCode().equals(type)){
                return type;
            }
        }
        return null;
    }
}
